package com.google.code.UtopiaXml;

import java.util.List;

/**
 * Class encapsulating a parsed XSD. It consists of all classes, all classes
 * that can appear as a root and schema name used for validation
 *
 * @author Michael Simacek
 */
public class Schema {

    private List<ClassTemplate> classes;
    private List<ComplexType> roots;
    private String schemaName;

    /**
     * Creates schmema with given lists of classes and name.
     *
     * @param classes All ClassTemplates that appear in a schema
     * @param roots All classes that can appear as a root
     * @param schemaName Name of the schema file to be used for validation
     */
    public Schema(List<ClassTemplate> classes, List<ComplexType> roots, String schemaName) {
        this.classes = classes;
        this.roots = roots;
        this.schemaName = schemaName;
    }

    /**
     * Returns schema filename
     *
     * @return schema file name
     */
    public String getSchemaName() {
        return schemaName;
    }

    /**
     * Returns all classes
     *
     * @return all classes
     */
    public List<ClassTemplate> getClasses() {
        return classes;
    }

    /**
     * Returns all roots
     *
     * @return all roots
     */
    public List<ComplexType> getRoots() {
        return roots;
    }

    /**
     * Sets schema file name
     *
     * @param schemaName schema name
     */
    public void setSchemaName(String schemaName) {
        this.schemaName = schemaName;
    }
}
